<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('score/index_student')}">成绩列表</a></li>
        <li><a href="{:url('Score/add_Student')}?sid={$sid}">录入成绩</a></li>
    </ul>
    <!-- 搜索 -->
    <form class="well form-inline margin-top-20" method="get" action="{:url('Score/index_student')}">
        学生姓名：
        <input type="text" class="form-control" value="{$Request.param.name}" name="name" style="width: 150px;"  placeholder="请输入学生姓名">
        <select name="term_id" class="form-control">
            <option value="">请选择学期</option>
            <foreach name="term" item="vo">
                <option value="{$vo.id}" <if $Request.param.term_id == $vo.id> selected </if> >{$vo.term_name}</option>
            </foreach>
        </select>
        <select name="subject_id" class="form-control">
            <option value="">请选择科目</option>
            <foreach name="course" item="vo">
                <option value="{$vo.id}" <if $Request.param.subject_id == $vo.id> selected </if> >{$vo.course_name}</option>
            </foreach>
        </select>
        <input type="hidden" name="sid" value="{$sid}">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('score/index_student')}?sid={$sid}">清空</a>
    </form>
    <!-- 搜索结束 -->

    <form class="margin-top-20 js-ajax-form" action="{:url('score/batchDelete')}">
        <div class="table-actions">
            <button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
                    data-subcheck="true" onclick="return confirm('确定删除吗？');">
                批量删除
            </button>
        </div>
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></th>
                <th>ID</th>
                <th>学生姓名</th>
                <th>学期名称</th>
                <th>科目名称</th>
                <th>成绩</th>
                <th>{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td><input type="checkbox" class="js-check" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
                    <td>{$key + 1}</td>
                    <td>{$vo.student.name}</td>
                    <td>{$vo.term.term_name}</td>
                    <td>{$vo.course.course_name}</td>
                    <td>
                        <if $vo.score < 60>
                        <span style="color: red;">{$vo.score}</span>
                        <else />
                        {$vo.score}
                        </if>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-success"  href="{:url('Score/edit', array('id' => $vo['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Score/delete', array('id' => $vo['id']))}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
        <div class="">
            共 {$data->total()} 条数据，当前第 {$data->currentPage()} 页，共 {$data->lastPage()} 页
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>